package com.doitedu.day03.funcs

/**
 * @Date 22.6.22
 * @Created by HANGGE
 * @Description
 */
object _04类型转换 {
  def main(args: Array[String]): Unit = {
    val str: String = "21"
   // val x:Any = "21"  // Any = String  => Int
   // val i = str.toInt * 10
   // println(i)

   // println(x.asInstanceOf[Int] * 10)
    val array  = Array(1,2,"21")
    for (elem <- array) {
      if (elem.isInstanceOf[String]){
        val i = elem.asInstanceOf[String]
        println(i.toInt * 10)
      }
    }








  }

}
